<template>
    <div class="case-detail">
        <div class="breadcrumb-list">
            <div class="breadcrumb-item">
                <span class="back">返回</span>
                <nuxt-link href="/">云空间</nuxt-link>
                <el-icon size="16" color="#666">
                    <DArrowRight />
                </el-icon>
            </div>
        </div>

        <DefaultM :detail="detail" @onCaseView="onCaseView('url')" @onCaseExperience="onCaseExperience"
            v-if="detail.style == 0" />

        <ExaminationSystemM @onCaseView="onCaseView('url')" @onCaseExperience="onCaseExperience" :detail="detail"
            v-else-if="detail.style == 1" />

        <!-- 推荐案例 -->
        <div class="case-detail__title">推荐案例</div>

        <div class="recommend-list">
            <CaseItemM v-for="item in recommend" :item="item" :key="item.id" />
        </div>
    </div>

    <!-- 多级-2层 -->
    <LazyDialogCaseListM ref="CaseListDialogRef" :dataList="dataCaseList" />

    <LazyDialogCaseContactM ref="CaseContactDialogRef" />
    <LazyDialogCaseMenusM ref="CaseMenusDialogRef" />
</template>
<script setup>
import { useContent } from ".";
import { DArrowRight } from "@element-plus/icons-vue";
import DefaultM from "./components/Default/M";
import ExaminationSystemM from "./components/ExaminationSystem/M";
const {
    recommend,
    dataCaseList,
    CaseListDialogRef,
    detail,
    CaseContactDialogRef,
    CaseMenusDialogRef,
    onCaseView,
    onCaseExperience,
    GetDetail,
    getRecommendCase,
} = useContent();

onMounted(async () => {
    await GetDetail();
    getRecommendCase(4);

    useSeoMeta({
        title: detail.value.name + "-北京华锐云空间",
    });
});
</script>
<style lang="scss" scoped>
.case-detail {
    padding: 10px 0;
    background-color: #fff;
    min-height: calc(100vh - 44px);

    &__title {
        color: #333;
        font-size: 17px;
        font-weight: 600;
        margin-bottom: 14px;
        padding: 0 15px;
    }

    .breadcrumb-list {
        margin-bottom: 20px;
        padding: 0 15px;

        .breadcrumb-item {
            display: flex;
            align-items: center;
            font-size: 16px;
            line-height: 1;
            user-select: none;

            .back {
                color: #5085fb;
                cursor: default;
            }

            a {
                color: #5085fb;
                text-decoration: none;
            }

            .el-icon {
                margin: 0 5px;
                margin-top: 1px;
            }
        }
    }

    .recommend-list {
        display: flex;
        flex-wrap: wrap;
        padding: 0 15px;
    }
}
</style>
